package day01;

import org.apache.spark.SparkConf;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.JavaSparkContext;
import org.apache.spark.api.java.function.FlatMapFunction;

import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

/**
 * @Author:wsl
 * @Data:2023/02/14/16:56
 * @Description:
 */
public class WC {
    public static void main(String[] args) {
        SparkConf conf = new SparkConf().setMaster("").setAppName("");
        JavaSparkContext sc = new JavaSparkContext(conf);

        JavaRDD<String> lineRDD = sc.textFile("");
        JavaRDD<String> flatMap = lineRDD
                .flatMap(new FlatMapFunction<String, String>() {
                    @Override
                    public Iterator<String> call(String s) throws Exception {
                        List<String> strings = Arrays.asList(s.split(" "));
                        return strings.iterator();
                    }
                });


    }
}
